<form id="pagefm" method="post" novalidate>
            <div class="fitem">
                <label>自定义名称:</label>
                <input name="name">
            </div>
            <div class="fitem">
                <label>选择页面:</label>
                <input id="avaiablePage" name="page">
            </div>       
    <div id="pagefm-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="javascript:pageActionJs.submitAddPage()">确定</a>
    </div>                  
</form>

<script type="text/javascript">

(function(pageActionJs, $, undefined ) {
	pageActionJs.init = function(){
	workbenchJs.loadData("dispatch/manage/page/avaialbe",pageActionJs.loadAvaiablePageResult,"查询快捷链接");
};

pageActionJs.submitAddPage = function(){
	var json = {};
	json.name = $("#pagefm input[name='name']").val();
	json.page = parseInt($("#pagefm input[name='page']").val());

	var str = $.toJSON(json);
	str = 'parameters='+str;
	if($('#pagefm').form('validate'))
	{
		$.ajax({
            type: "post",
            url: "dispatch/manage/page/add",
            dataType:"json",
            data: str,
            cache: false,
            success: function (result) {
            	var res = result.result;
                if(res == "SUCCESS")
                {
                	workbenchJs.closeAddPage();
                }else if(res == "COMPONENT_ERROR")
                {
                	$.messager.alert("Error",result.payload.value);
                }else
                {
                	$.messager.alert("Error",result.result);
                }
                
            }
            
        });
	}
}
pageActionJs.loadAvaiablePageResult = function(result){
	var res = result.result;
    if(res == "SUCCESS")
    {
    	var payload = jQuery.parseJSON(result.payload.value);
    	$('#avaiablePage').combobox({
    		url:null,
    		valueField:'id',
    		textField:'display',
    		multiple:false,
    		panelHeight:'auto',
    		data:payload
    	});
    }else if(res == "COMPONENT_ERROR")
    {
    	$.messager.alert("Error",result.payload.value);
    }else
    {
    	$.messager.alert("Error",result.result);
    }
	
}
}( window.pageActionJs = window.pageActionJs || {}, jQuery ));

$(function(){
	pageActionJs.init();
});
	</script>
	
	    <style type="text/css">
        #pagefm{
            margin:0;
            padding:10px 30px;
        }
        .ftitle{
            font-size:14px;
            font-weight:bold;
            padding:5px 0;
            margin-bottom:10px;
            border-bottom:1px solid #ccc;
        }
        .fitem{
            margin-bottom:5px;
        }
        .fitem label{
            display:inline-block;
            width:80px;
        }
    </style>